package cn.edu.njuit.lesson9heros;

import cn.edu.njuit.lesson9heros.springioc.SpringGameStarter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class Lesson9HerosApplication {

    public static void main(String[] args) {
        //初始化Spring容器
        ConfigurableApplicationContext applicationContext=SpringApplication.run(
                Lesson9HerosApplication.class, args);
        //从容器中获取指定的对象
        SpringGameStarter starter=applicationContext.getBean(SpringGameStarter.class);
        //使用对象
        starter.start();

    }

}
